// 导入路由vue和VueRouter
import Vue from 'vue'
import VueRouter from 'vue-router'

// // 引入要展示的组件
// import Index from '@/views/index/index'
// import List from '@/views/EquipmentList/Index/index.vue'
// 表格
// import External from '@/views/EquipmentList/assList/external.vue'
// import Network from '@/views/EquipmentList/assList/network.vue'
// import Security from '@/views/EquipmentList/assList/security.vue'
// import Sever from '@/views/EquipmentList/assList/sever.vue'
// import Software from '@/views/EquipmentList/assList/software.vue'
// import GenPage from '@/views/genPage/index.vue'
//文件汇编
import FileIndex from '@/views/file/fileIndex.vue'
// 资产清单的首页
// import ListIndex from '@/views/EquipmentList/listIndex/listIndex.vue'
// 设备分类图片
// import SeverClass from '@/views/EquipmentList/classList/severClass.vue'
// import NetClass from '@/views/EquipmentList/classList/netClass.vue'
// import SecurityClass from '@/views/EquipmentList/classList/securityClass.vue'
// import SoftwareClass from '@/views/EquipmentList/classList/softwareClass.vue'
// import ReceiveClass from '@/views/EquipmentList/classList/receiveClass.vue'
// 设备实物图
// import SeverReality from '@/views/EquipmentList/reality/serve.vue'
// import netReality from '@/views/EquipmentList/reality/net.vue'
// import SecureReality from '@/views/EquipmentList/reality/secure.vue'
// import AcceptReality from '@/views/EquipmentList/reality/accept.vue'

// 将VueRouter安装为vue的插件
Vue.use(VueRouter)

// 把下面的代码粘贴到路由模块中对应的位置，即可防止路由报错的问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
const routes = [
  // {path: '/listIndex', component: ListIndex},
  {
    path:'/login',
    component: () => import('@/views/Login/index.vue')
  },
  {
    path:'/reg',
    component: () => import('@/views/Reg/index.vue')
  },
  {
    path: '/',
    redirect: '/index',
  },
  {
    path: '/index',
    component: () => import('@/views/index/index.vue')
  },
  {
    path: '/fileIndex', 
    // compontent: () => import('@/views/file/fileIndex.vue')
    component: FileIndex
  },

  // {
  //   path: '/severClass', 
  //   component: SeverClass,
   
  // },
  // sever实物
  // {
  //   path: '/SeverReality', 
  //   component: () => import('@/views/EquipmentList/reality/serve.vue'),
  // },
  // sever清单
  // {
  //   path: '/Sever', 
  //   component: () => import('@/views/EquipmentList/assList/sever.vue'),
  // },
  // {
  //   path: '/netClass', 
  //   component: NetClass,
  // },
  // // 实物
  // {
  //   path: '/NetReality', 
  //   component: () => import('@/views/EquipmentList/reality/net.vue'),
  // },
  // // 清单
  // {
  //   path: '/Network', 
  //   component: () => import('@/views/EquipmentList/assList/network.vue'),
  // },
  // {
  //   path: '/securityClass', 
  //   component: SecurityClass,
  // },
  // // 实物
  // {
  //   path: '/SecureReality', 
  //   component: () => import('@/views/EquipmentList/reality/secure.vue'),
  // },
  // // 清单
  // {
  //   path: '/Security', 
  //   component: () => import('@/views/EquipmentList/assList/security.vue'),
  // },
  // {
  //   path: '/softwareClass', 
  //   component: SoftwareClass,
  // },
  // // 清单
  // {
  //   path: '/Software', 
  //   component: () => import('@/views/EquipmentList/assList/software.vue'),
  // },
  // {
  //   path: '/receiveClass', 
  //   component: ReceiveClass,
  // },
  // // 实物
  // {
  //   path: '/acceptReality', 
  //   component: () => import('@/views/EquipmentList/reality/accept.vue'),
  // },
  // // 清单
  // {
  //   path: '/External', 
  //   component: () => import('@/views/EquipmentList/assList/external.vue'),
  // },
  // {path: '', component: },
  // {path: '/', component: },
// // {path: 'hash地址', component: '要展示的组件'}
// // 路由重定向 {path: '当前地址', redirect: '重定向地址'},
//   {path: '/', redirect: '/index'},
//   {
//     path: '/list', 
//     redirect: '/list/sever',
//     component: () => import('@/views/EquipmentList/Index/index.vue'),
//     // 声明子路由规则
//     // 子路由path写法1
//     // {path: '/父路由/子路由', component: 组件}
//     children: [
//        // 子路由path写法1
//       // {path: '/父路由/子路由', component: 组件}
//       // {path: '/list/external', component: External},
//       // 子路由path写法2:
//       // 子路由地址前不能加 /
//       {path: 'external', component: External},
//       {path: 'network', component: Network},
//       {path: 'security', component: Security},
//       {path: 'sever', component: Sever},
//       {path: 'software', component: Software}
    // ]
  // },

  
  
]
// 创建路由实例对象
const router = new VueRouter({
  // 使用routers配置路由规则
  // 路由规则：hash地址和对应的组件
  routes
})
// 导出路由实例对像 
export default router